@(registerForm: Form[RegisterForm])(implicit lang: Lang)

@import helper._
@implicitFieldConstructor = @{ FieldConstructor(bootstrap.render) }

@main("The Cult Cinema Inc. Register ") {

	<section style="padding-top:120px">
				<div class="row">
					<div class="span12">
						<ul class="breadcrumb">
							<li><a href="@routes.Application.index(lang.code)">@Messages("home")(lang)</a> <span class="divider">/</span></li>
		        			<li class="active">@Messages("register")(lang)</li>
		        		</ul>
					</div>
				</div>

				@if(registerForm.hasErrors) {
					<div class="row">
						<div class="span12">
				    	    <div class="alert-error alert alert-block">
				    	    	<h4 class="alert-heading">ERROR
					    	    	@if(registerForm.globalError != null) { # @Messages(registerForm.globalError.message)(lang) }
				    	    	</h4>
					    	</div>
						</div>
					</div>
				}

				<div class="row">
			    	<div class="span8">
					    @helper.form(action = routes.Member.register, 'class -> "form-horizontal well") {

					        <fieldset>
					            <legend><i class="icon-user"></i> @Messages("register.memberRegistration")(lang)</legend>

								@inputText(
					                registerForm("username"),
					                '_label -> Messages("username")(lang),
					                '_help -> Messages("register.help.chooseValidUsername")(lang),
					                '_error -> registerForm.globalError
					            )

					            @inputPassword(
					                registerForm("password"),
					                '_label -> Messages("password")(lang),
					                '_help -> Messages("register.help.passwordMustBeSixCharacters")(lang)
					            )

								@inputPassword(
					                registerForm("confirmPassword"),
					                '_label -> Messages("register.confirmPassword")(lang),
					                '_help -> Messages("register.help.reEnterPassword")(lang)
					            )

								@inputText(
					                registerForm("email"),
					                '_label -> Messages("email")(lang),
					                '_help -> Messages("register.help.enterValidEmail")(lang),
					                '_error -> registerForm.globalError
					            )

								@inputText(
					                registerForm("credit_card"),
					                '_label -> Messages("creditCard")(lang),
					                '_help -> Messages("register.help.enterCreditCardNumber")(lang),
					                '_error -> registerForm.globalError
					            )

								<input type="hidden" name="lang" value="@lang.code">

					        </fieldset>

					        <div class="form-actions">
					        	<button type="submit" class="btn btn-primary">@Messages("register")(lang)</button>
					        	<button type="reset" class="btn">@Messages("register.reset")(lang)</button>
					        </div>
					    }

					</div>
					<div class="span4">
						<div class="well">
							<h4><i class="icon-lock"></i> @Messages("register.security")(lang)</h4>
							<p>@Messages("register.security.message")(lang)</p>
						</div>
			    </div>
			</section>

}(lang)
